
import { useStore } from 'vuex'


/**
 * 判断是否是开发者账号登录
 * @returns 
 */
export function isDeveloper() {
    const store = useStore()
    if(null != store.state.user.roles && store.state.user.roles.length > 0 && "developer"==store.state.user.roles[0]){
        return true
    }
    return false
}

/**
 * 获取当前用户信息
 * @returns 
 */
export function getUserInfo() {
    let userInfo = {}
    const store = useStore()
    if(null != store.state.user){
        userInfo.id = store.state.user.id
        userInfo.username = store.state.user.username
        userInfo.realName = store.state.user.realName
    }
    return userInfo
}

